#include "PlatformProperty.h"


SYSTEM_READ_WRITE_PROPERTY(AP_POWER_STATE_REPORT, std::vector<int32_t>) {
    builder.area(VehicleArea::GLOBAL)
        .initValue([]() { 
            std::vector<int32_t> dft = std::vector<int32_t>(toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL), 0);
            return dft; 
        })
        .immutableStatus(PropertyStatus::Active)
        .withValueBySignals([]([[maybe_unused]] const std::vector<int32_t> &last) {
            return last;
        })
        .onSetProperty([this](const std::vector<int32_t> value) {
            if (value.size() != 2) {
                VHALOG.e("AP_POWER_STATE_REPORT : param invalid");
                return;
            }
            VHALOG.d("HalOnSetProperty AP_POWER_STATE_REPORT :[0]=[%d],[1]=[%d]",
                        value[0], value[1]);
            setValue(toInt(VehicleArea::GLOBAL), value);
        });
}
